package com.sky.controller;

import com.sky.domain.UmsMemberReceiveAddress;
import com.sky.service.UmsMemberReceiveAddressService;
import com.sky.service.UmsMemberService;
import com.sky.utils.R;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/umsMemberAddress")
public class MemberReceiveAddressController {

    @Resource
    private UmsMemberReceiveAddressService memberReceiveAddressService;

    @GetMapping("/getAddressByMemberId")
    public R<List<String>> getAddressByMemberId(@RequestParam("memberId") Long memberId) {
        return R.ok(memberReceiveAddressService.getAddressByMemberId(memberId));
    }

    @GetMapping("/getAddressById")
    public R<UmsMemberReceiveAddress> getAddressById(@RequestParam("addrId") Long addrId) {
        return R.ok(memberReceiveAddressService.getAddressById(addrId));
    }
}
